﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MediaPortal.DeployTool;

namespace Microsoft.HomeServer.HomeServerConsoleTab.TV4Home.Server.WHS.AddIn.Wizards.InstallTVServer
{
    public partial class WPTvServerSettingsControl : UserControl
    {
        public WPTvServerSettingsControl()
        {
            InitializeComponent();
        }

        public void InitializeUI()
        {
            // TV server install directory
            if (String.IsNullOrEmpty(InstallationProperties.Instance["TVServerDir"]))
                this.TvServerDirectory = Utils.CommonPaths.TVServer_InstallDirectory;  // set default value for install directory
            else
                this.TvServerDirectory = InstallationProperties.Instance["TVServerDir"];

            // TV server firewall configuration
            if (String.IsNullOrEmpty(InstallationProperties.Instance["ConfigureTVServerFirewall"]))
                this.ConfigureFirewallTVServer = true;
            else
                this.ConfigureFirewallTVServer = Convert.ToInt32(InstallationProperties.Instance["ConfigureTVServerFirewall"]) == 1;
        }

        public string TvServerDirectory
        {
            get { return txtTVServerInstallDir.Text; }
            private set { txtTVServerInstallDir.Text = value; }
        }

        public bool ConfigureFirewallTVServer
        {
            get { return chkConfigureFirewall.Checked; }
            private set { chkConfigureFirewall.Checked = value; }
        }
    }
}
